package practice;

import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;

public class p009 {
    public static void main(String[] args) {
        FileReader reader = null;
        try {
            reader = new FileReader("temp001.txt");
            char[] chars = new char[4];
            int count = 0;
            while((count = reader.read(chars)) != -1){
                System.out.println(new String(chars,0,count));
            }
        }
        catch (FileNotFoundException e ){
            e.printStackTrace();
        }
        catch(IOException e ){
            e .printStackTrace();
        }
        finally {
            if(reader != null){
                try {
                    reader.close();
                }
                catch (IOException e ){
                    e.printStackTrace();
                }
            }

        }
    }
}
